<template>
  <div class="serviceManage">
    <div class="detail">
      <div class="head"><span>会议详情</span></div>
      <div class="info">
        <table>
          <tr>
            <td>会议号 :</td>
            <td>{{ info.cfCode }}</td>
            <td>参会人 :</td>
            <td
              v-if="info.personCount != 0"
              class="blue cp"
              @click="topeople(info.cfId)"
            >
              {{ info.personCount }}
            </td>
            <td v-else>{{ info.personCount }}</td>
          </tr>
          <tr>
            <td>会议名称 :</td>
            <td>{{ info.cfName }}</td>
            <td>会议文档 :</td>
            <td
              v-if="info.fileCount != 0"
              class="blue cp"
              @click="tofile(info.cfId)"
            >
              {{ info.fileCount }}
            </td>
            <!-- <td v-else  @click="tofile(info.cfId)">{{ info.fileCount }}</td> -->
          </tr>

          <tr>
            <td>开始时间 :</td>
            <td>{{ info.cfStartTime?setLocalTime( info.cfStartTime):info.cfStartTime }}</td>
          </tr>
          <tr>
            <td>会议时长 :</td>
            <td>{{ info.duration }}</td>
          </tr>
          <tr class="jiyao">
            <td class="desc">会议纪要 :</td>
            <td colspan="4">{{ info.cfMinutes }}</td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {}
  },
  created () {
    this.$store.dispatch('cfManage/getDetailData', { cfId: this.id }).catch(err => {
      this.$message({
        type: 'error',
        message: err,
        duration: 1000
      })
    })
  },
  computed: {
    id () {
      return Number(sessionStorage.getItem('cfid'))
    },
    info () {
      return this.$store.state.cfManage.tableData
    }
  },
  methods: {
    topeople (id) {
      this.$router.push({
        path: '/cfManagedetailPeople'
      })
    },
    tofile (id) {
      this.$router.push({
        path: '/cfManagedetailFile'
      })
    },
    setLocalTime (time) {
      return this.$moment(+new Date(time)).format('YYYY-MM-DD HH:mm:ss')
    }
  }
}
</script>

<style lang="scss" scoped>
.serviceManage {
  .detail {
    min-height: 932px;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 8px;
    // margin-top: 24px;
    padding: 0 24px;
  }
  .head {
    width: 100%;
    height: 78px;
    border-bottom: 1px solid #e6e9f0;
    position: relative;
    font-size: 16px;
    font-weight: 500;
    color: #1b1f35;
    span {
      position: absolute;
      bottom: 20px;
    }
  }
  .info {
    margin-top: 53px;
    margin-left: 20px;
    tr {
      color: #3d4966;
      vertical-align: top;
      td:nth-child(1) {
        width: 76px;
        height: 50px;
        color: #1b1f35;
        text-align: right;
      }
      td:nth-child(2) {
        padding-left: 20px;
        width: 396px;
      }
      td:nth-child(3) {
        width: 79px;
        text-align: right;
      }
      td:nth-child(4) {
        padding-left: 20px;
        width: 807px;
      }
    }
  }
}
</style>
